package com.qh.physicsexperiment.domin;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qh.physicsexperiment.utils.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@TableName("experiment")
@Data
@NoArgsConstructor  //空参构造方法
@AllArgsConstructor //全参构造方法
@Accessors(chain = true)//作用是使成员属性的set方法不再返回void，而是返回对象本身，从而实现链式赋值。
@EqualsAndHashCode(callSuper = true)//父类属性不参与equal
@ApiModel(value="Experiment对象", description="实验信息")
public class Experiment extends BaseEntity {

    /**
     * 实验序号
     */
    @ApiModelProperty(value = "实验序号",notes = "无自增",required = true,allowableValues = "2",dataType = "Integer")
    @Pattern(regexp = "^d{2}$",message = "实验序号不对")
    private Integer id;

    /**
     * 实验名称
     */
    @ApiModelProperty(value = "实验名称",dataType = "String")
    private String name;

    //反序列化唯一标识？没看懂
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
